#include <asm/mmu_context.h>
#include <asm-xen/foreign_page.h>
+#include <asm-xen/hypervisor.h>
void show_mem(void)
{
{
unsigned long flags;
+#ifdef CONFIG_X86_PAE
+ /* this gives us a page below 4GB */
+ xen_contig_memory((unsigned long)pgd, 0);
+#endif
+
if (!HAVE_SHARED_KERNEL_PMD)
spin_lock_irqsave(&pgd_lock, flags);
unsigned long _initrd_start, unsigned long initrd_len,
char *cmdline)
{
- int i, rc, dom0_pae, xen_pae;
+ int i, rc, dom0_pae, xen_pae, order;
unsigned long pfn, mfn;
unsigned long nr_pages;
unsigned long nr_pt_pages;
nr_pages = avail_domheap_pages() +
((initrd_len + PAGE_SIZE - 1) >> PAGE_SHIFT) +
((image_len + PAGE_SIZE - 1) >> PAGE_SHIFT);
- if ( (page = alloc_largest(d, nr_pages)) == NULL )
- panic("Not enough RAM for DOM0 reservation.\n");
- alloc_spfn = page_to_pfn(page);
- alloc_epfn = alloc_spfn + d->tot_pages;
if ( (rc = parseelfimage(&dsi)) != 0 )
return rc;
#endif
}
- if ( ((v_end - dsi.v_start) >> PAGE_SHIFT) > (alloc_epfn - alloc_spfn) )
- panic("Insufficient contiguous RAM to build kernel image.\n");
+ order = get_order(v_end - dsi.v_start);
+ if ( (1UL << order) > nr_pages )
+ panic("Domain 0 allocation is too small for kernel image.\n");
+
+ /* Allocate from DMA pool: PAE L3 table must be below 4GB boundary. */
+ if ( (page = alloc_domheap_pages(d, order, ALLOC_DOM_DMA)) == NULL )
+ panic("Not enough RAM for domain 0 allocation.\n");
+ alloc_spfn = page_to_pfn(page);
+ alloc_epfn = alloc_spfn + d->tot_pages;
printk("PHYSICAL MEMORY ARRANGEMENT:\n"
" Dom0 alloc.: %"PRIphysaddr"->%"PRIphysaddr,